<!-- inc:header -->
<script type="text/javascript">
function to_link(t)
{
	var turl = base_file + "?"+base_ctrl+"=link&"+base_func+"="+t+"&input_id=link_url";
	Layer.init(turl,550,400);
}
</script>

<div class="notice"><div class="p">
	<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td><span class="lead">&nbsp;&raquo; <a href="{:site_url('list')}module_id={:$module_id}&">{:$m_rs[title]}</a> &raquo; 添加/编辑信息</span></td>
	</tr>
	</table>
</div></div>

<div class="tab">
	<table cellpadding="0" cellspacing="0">
	<tr>
		<td width="150px">&nbsp;</td>
		<td class="over" id="_tab_main" title="主要内容信息，其中红色星号信息为必填" onclick="tab_set('main')">主要信息</td>
		<!-- if($m_rs[if_biz]) -->
		<td width="20px">&nbsp;</td>
		<td class="out" id="_tab_biz" title="电子商务功能，可在这里设置相关价格，优惠促销等" onclick="tab_set('biz')">电子商务</td>
		<!-- else -->
		<td width="10px" id="_tab_biz" style="display:none;">&nbsp;</td>
		<!-- end -->
		<td width="20px">&nbsp;</td>
		<!-- if($m_rs[if_ext]) -->
		<td class="out" id="_tab_ext" title="所有用户在后台创建模块时设定的一些非必填的扩展字段均在这里使用" onclick="tab_set('ext')">可选扩展</td>
		<!-- else -->
		<td width="10px" id="_tab_ext" style="display:none;">&nbsp;</td>
		<!-- end -->
		<td width="10px">&nbsp;</td>
		<td>（<span style="color:red;">*</span> 号必填）</td>
	</tr>
	</table>
</div>

<form method="post" action="{:site_url('list,setok')}module_id={:$module_id}&id={:$id}" onsubmit="return to_submit();">

<div id="style_setting" style="display:none;">
	<div>
		<textarea style="width:98%;height:60px;" id="style" name="style">{:$rs[style]}</textarea>
	</div>
	<div style="margin-top:5px;">
		<input type="button" class="btn2" value="加粗" onclick="style_set('font-weight:bold');">
		<input type="button" class="btn2" value="斜体" onclick="style_set('font-style:italic');">
		<input type="button" class="btn3" value="下划线" onclick="style_set('text-decoration:underline');">
		<select name="color" onchange="style_color(this.value);">
		<option value="">默认颜色</option>
		<option value="red" style="color:red;">红色</option>
		<option value="darkred" style="color:darkred;">深红色</option>
		<option value="green" style="color:green;">绿色</option>
		<option value="darkgreen" style="color:darkgreen;">深绿色</option>
		<option value="blue" style="color:blue;">蓝色</option>
		<option value="darkblue" style="color:darkblue;">深蓝色</option>
		<option value="purple" style="color:purple;">紫色</option>
		<option value="yellow" style="color:yellow;">黄色</option>
		<option value="gold" style="color:gold;">金色</option>
		<option value="saddlebrown" style="color:saddlebrown;">棕色</option>
		</select>
		<input type="button" value="清空" class="btn2" onclick="$('#style').attr('value','');" />
		<input type="button" value="关闭" class="btn2" onclick="Layer.over();" />
	</div>
	<div class="clue_on" style="margin-top:5px;">填写完CSS后，点击关闭即可，无需提交操作</div>
</div>


<div id="_msg_main">

	<!-- if($ifcate) -->
	<div class="table">
		<div class="left"><span class="red">*</span> 分类：</div>
		<!-- if($id) -->
		<input type="hidden" id="cate_id" name="cate_id" value="{:$rs[cate_id]}" />
		<select disabled><option>{:$cate_rs[cate_name]}</option></select><span class="clue_on">&nbsp;分类不允许修改，请到列表中迁移</span>
		<!-- else -->
		<select name="cate_id" id="cate_id" onchange="direct('{:site_url('list,set')}module_id={:$module_id}&cateid='+this.value)">
		<!-- $cate_list_array AS $key=>$value -->
		<option value="{:$value[id]}"{if($cate_id == $value[id])} selected{end}>{:$value[space]}{:$value[cate_name]}</option>
		<!-- end -->
		</select>
		<!-- end -->
	</div>
	<!-- end -->

	<div class="table">
		<div class="left"><span class="red">*</span> <!-- if($m_rs[title_nickname]) -->{:$m_rs[title_nickname]}<!-- else -->主题<!-- end -->：</div>
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td><input type="text" name="subject" id="subject" class="long_input" value="{:$rs[title]}"></td>
			<td>&nbsp;</td>
			<td><a href="javascript:Layer.inline('style_setting',430,145);void(0);" title="请将CSS写在文本框中，不超过200字符，不熟悉CSS请留空" class="btn reply"></a></td>
		</tr>
		</table>
	</div>

	<!-- if($m_rs[if_subtitle]) -->
	<div class="table">
		<div class="left"><!-- if($m_rs[subtitle_nickname]) -->{:$m_rs[subtitle_nickname]}<!-- else -->副主题<!-- end -->：</div>
		<input type="text" name="subtitle" id="subtitle" value="{:$rs[subtitle]}" class="long_input">
		<span class="clue_on"> 如需要，请填写</span>
	</div>
	<!-- else -->
	<input type="hidden" id="subtitle" name="subtitle" value="" />
	<!-- end -->

	<!-- if($m_rs[if_sign_m]) -->
	<div class="table">
		<div class="left"><span class="red">*</span> <!-- if($m_rs[sign_nickname]) -->{:$m_rs[sign_nickname]}<!-- else -->标识串<!-- end -->：</div>
		<input type="text" name="identifier" id="identifier" value="{:$rs[identifier]}" onblur="to_check_one('{:intval($id)}','identifier',true,true)">
		<span class="clue_on"> <span id="identifier_note" class="red"></span> 仅限字母、下划线及数字。</span>
	</div>
	<!-- end -->


	<!-- if($m_rs[if_propety]) -->
	<div class="table">
		<div class="left">属性：</div>
		<table>
		<tr>
			<td><input type="checkbox" name="istop" id="istop" value="1"{if($rs[istop])}checked{end}></td>
			<td>置顶&nbsp;</td>
			<td><input type="checkbox" name="isvouch" id="isvouch" value="1"{if($rs[isvouch])}checked{end}></td>
			<td>推荐&nbsp;</td>
			<td><input type="checkbox" name="isbest" id="isbest" value="1"{if($rs[isbest])}checked{end}></td>
			<td>精华</td>
		</tr>
		</table>
	</div>
	<!-- end -->

	<!-- if($m_rs[if_url_m]) -->
	<div class="table">
		<div class="left"><!-- if($m_rs[if_url_m] == 2) --><span class="red">*</span> <!-- end -->链接网址：</div>
		<input type="text" name="link_url" id="link_url" class="long_input" value="{:$rs[link_url]}">
		<select name="target" id="target">
		<option value="0">当前窗口</option>
		<option value="1"{if($rs[target])} selected{end}>新窗口</option>
		</select>
	</div>
	<div class="table">
		<div class="left">&nbsp;</div>
		<input type="button" class="btn2" value="模块" onclick="to_link('module')" />
		<input type="button" class="btn2" value="分类" onclick="to_link('cate')" />
		<input type="button" class="btn2" value="主题" onclick="to_link('subject')" />
		<span class="clue_on">站内链接，仅限动态链接，如需伪静态页链接或是静态页链接，请手动调整</span>
	</div>
	<!-- end -->

	<!-- if($m_rs[if_thumb]) -->
	<input type="hidden" name="thumb_id" id="thumb_id" value="{:$rs[thumb_id]}">
	<div class="table">
		<div class="left">
			<div style="padding-bottom:3px;"><!-- if($m_rs[if_thumb_m]) --><span class="red">*</span> <!-- end -->缩略图：</div>
			<div style="padding-bottom:3px;"><input type="button" class="btn2" value="选择" onclick="phpjs_img('thumb_id','thumb_view');" /> &nbsp;</div>
			<input type="button" value="删除" class="btn2" onclick="phpjs_clear_img('thumb_id','thumb_view')" /> &nbsp;
		</div>
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td align="left" id="thumb_view"><!-- if($rs[thumb]) --><img src="{:$rs[thumb]}" width="80px" height="80px" border="0" /><!-- else --><img src="images/nopic.gif" border="0" /><!-- end --></td>
		</tr>
		</table>
	</div>
	<!-- end -->

	<!-- if($m_rs[if_des]) -->
	<div class="table">
		<div class="left">简要描述：</div>
		<table cellpadding="0" cellspacing="0">
		<tr>
			<td><textarea id="note" name="note" style="width:622px;height:75px;overflow:hidden;">{:$rs[note]}</textarea></td>
		</tr>
		<tr>
			<td style="padding-top:4px" class="clue_on">简要描述当前主题的内容，不超过80个中文字</td>
		</tr>
		</table>
	</div>
	<!-- else -->
	<input type="hidden" id="note" name="note" value="" />
	<!-- end -->

	<!-- $extlist_must AS $key=>$value -->
	{:$value}
	<!-- end -->

</div>
<div id="_msg_biz">
	<div class="table">
		<div class="left">售价：</div>
		<input type="text" name="price" id="price" value="{:$rs[price]}">
		<span class="clue_on"> 这里的售价均为RMB</span>
	</div>
	<div class="table">
		<div class="left">虚拟产品：</div>
		<input type="checkbox" name="virtual" id="virtual" value="1"{if($rs[virtual])} checked{end}>
		<span class="clue_on"> 如果该产品是虚拟产品，请打上勾（购买虚拟产品不需填写地址，不计运费）</span>
	</div>
	<div class="table">
		<div class="left">特价：</div>
		<input type="checkbox" name="ifspecial" id="ifspecial" value="1"{if($rs[ifspecial])} checked{end}>
		<span class="clue_on"> 如果该价格是特价产品，请打上勾</span>
	</div>
	<div class="table">
		<div class="left">免费：</div>
		<input type="checkbox" name="free" id="free" value="1"{if($rs[free])} checked{end}>
		<span class="clue_on"> 如果该产品免费，请打上勾</span>
	</div>
	<div class="table">
		<div class="left">促销开始时间：</div>
		<input type="text" name="promotion_start" id="promotion_start" onfocus="show_date('promotion_start')" value="{:$rs[promotion_start] ? date('Y-m-d',$rs[promotion_start]) : ''}">
		<span class="clue_on"> 为空不促销</span>
	</div>
	<div class="table">
		<div class="left">促销结束时间：</div>
		<input type="text" name="promotion_end" id="promotion_end" onfocus="show_date('promotion_end')" value="{:$rs[promotion_end] ? date('Y-m-d',$rs[promotion_end]) : ''}">
		<span class="clue_on"> 为空表示促销将没有时间限制（如果有促销）</span>
	</div>
	<div class="table">
		<div class="left">重量：</div>
		<input type="text" name="weight" id="weight" class="short_input" value="{:$rs[weight]}">
		<span class="clue_on"> 单位是：Kg</span>
	</div>
	<div class="table">
		<div class="left">免运费：</div>
		<input type="checkbox" name="freeshipping" id="freeshipping" value="1"{if($rs[freeshipping])} checked{end}>
		<span class="clue_on"> 如果该产品免运费，请打上勾</span>
	</div>
</div>

<div id="_msg_ext">

	<!-- if(!$m_rs[if_sign_m]) -->
	<div class="table">
		<div class="left"><!-- if($m_rs[sign_nickname]) -->{:$m_rs[sign_nickname]}<!-- else -->标识串<!-- end -->：</div>
		<input type="text" name="identifier" id="identifier" value="{:$rs[identifier]}" onblur="to_check_one('{:intval($id)}','identifier',true,false)">
		<span class="clue_on"> <span id="identifier_note" class="red"></span> 仅限字母、下划线及数字。</span>
	</div>
	<!-- end -->

	<div class="table">
		<div class="left">模板文件：</div>
		<input type="text" name="tplfile" id="tplfile" value="{:$rs[tplfile]}">
		<span class="clue_on"> 不带后缀，不设置将使用系统自带模板文件：msg_{:$m_rs[identifier]}</span>
	</div>

	<div class="table">
		<div class="left">显示：</div>
		<input type="radio" name="hidden" value="0"{if(!$rs[hidden])} checked{end} /> 显示
		&nbsp; 
		<input type="radio" name="hidden" value="1"{if($rs[hidden])} checked{end} /> 隐藏
		<span class="clue_on"> 隐藏后列表中不体现，但用户仍可访问</span>
	</div>
	<div class="table">
		<div class="left">点击次数：</div>
		<input type="text" name="hits" id="hits" class="short_input" value="{:$rs[hits]}">
	</div>

	<!-- if($m_rs[if_hits]) -->
	<div class="table">
		<div class="left">好评与差评：</div>
		<input type="text" name="good_hits" id="good_hits" class="short_input" value="{:$rs[good_hits]}"> －
		<input type="text" name="bad_hits" id="bad_hits" class="short_input" value="{:$rs[bad_hits]}">
	</div>
	<!-- else -->
	<input type="hidden" name="good_hits" value="{:$rs[good_hits]}" />
	<input type="hidden" name="bad_hits" value="{:$rs[bad_hits]}" />
	<!-- end -->

	<div class="table">
		<div class="left"><span class="red">*</span> 发布人：</div>
		<select name="author_type" id="author_type">
		<option value="admin"{if($rs[author_type] == "admin")} selected{end}>管理员</option>
		<option value="user"{if($rs[author_type] == "user")} selected{end}>会员</option>
		<option value="guest"{if($rs[author_type] == "guest")} selected{end}>游客</option>
		</select>
		<input type="text" name="author" id="author" value="{:$rs[author] ? $rs[author] : $_SESSION[admin_name]}">
	</div>

	<div class="table">
		<div class="left"><span class="red">*</span> 发布时间：</div>
		<input type="text" name="post_date" id="post_date" onfocus="show_date('post_date',true);" value="{:date('Y-m-d H:i:s',$rs[post_date])}">
		<span class="clue_on"> 时间格式是：YYYY-MM-DD hh:ii:ss</span>
	</div>

	<div class="table">
		<div class="left">IP：</div>
		<input type="text" name="ip" value="{:$rs[ip]}">
		<span class="clue_on"> IP地址格式如：127.0.0.1，不清楚请不要留空或是保持显示值</span>
	</div>

	<!-- if($id) -->
	<div class="table">
		<div class="left">排序：</div>
		<input type="text" name="taxis" id="taxis" value="{:intval($rs[taxis])}" size="10">
		<input type="button" onclick="set_taxis_time('taxis');" class="btn4" value="时间戳排序">
		<span class="clue_on">值越大越往前靠</span>
	</div>
	<!-- end -->

	<div class="table">
		<div class="left">静态页模式：</div>
		<select name="htmltype" id="htmltype">
			<option value="cateid"{if($rs[htmltype] == "cateid")} selected{end}>HTML目录/语言ID/模块标识/分类标识/*.html</option>
			<option value="date"{if($rs[htmltype] == "date")} selected{end}>HTML目录/语言ID/年月/日/*.html</option>
			<option value="mid"{if($rs[htmltype] == "mid")} selected{end}>HTML目录/语言ID/模块标识/*.html</option>
			<option value="root"{if($rs[htmltype] == "root")} selected{end}>HTML目录/语言ID/*.html（注意不能为：index标识）</option>
		</select>
	</div>

	<!-- if($m_rs[if_point]) -->
	<div class="table">
		<div class="left">积分：</div>
		<input type="text" name="points" id="points" class="short_input" value="{:$rs[points]}">
	</div>
	<!-- end -->

	<div class="table">
		<div class="left">SEO关键字：</div>
		<input type="text" name="keywords" id="keywords" value="{:$rs[keywords]}" class="long_input">
		<span class="clue_on"></span>
	</div>

	<div class="table">
		<div class="left">&nbsp;</div>
		<span class="clue_on">这些信息将在title中的keywords体现，多个关键字请用英文逗号隔开</span>
	</div>

	<div class="table">
		<div class="left">SEO描述：</div>
		<input type="text" name="description" id="description" value="{:$rs[description]}" class="long_input">
		<span class="clue_on">内容描述，仅限SEO使用</span>
	</div>

	<!-- $extlist_need AS $key=>$value -->
	{:$value}
	<!-- end -->
</div>

<div class="table">
	<div class="left">&nbsp;</div>
	<table>
	<tr>
		<td><input type="submit" class="btn3" id="_phpok_submit" name="article_submit" value="提交"></td>
		<td>&nbsp; &nbsp;</td>
		<!-- if(!$id) -->
		<td>发布完成后返回：</td>
		<td><input type="radio" name="_go_back_action" value="add" checked /></td>
		<td>发布页 &nbsp; &nbsp;</td>
		<td><input type="radio" name="_go_back_action" value="list" /></td>
		<td>列表页 &nbsp; &nbsp;</td>
		<!-- end -->
	</tr>
	</table>
</div>

</form>

<script type="text/javascript">
var sign_nickname = "{:$m_rs[sign_nickname] ? $m_rs[sign_nickname] : '标识串'}";
var title_nickname = "{:$m_rs[title_nickname] ? $m_rs[title_nickname] : '主题'}";
var titleid = "{:intval($id)}";//主题ID
tab_set("main");
<!-- $extlist AS $key=>$value -->
	<!-- if($value[input] == "opt") -->
	phpjs_parent_opt('{:$value[default_val]}','{:$value[identifier]}','{:$value[id]}','{:$value[link_id]}');
	<!-- elseif($value[input] == "img") -->
	phpjs_viewpic('{:$value[default_val]}','{:$value[identifier]}');
	<!-- elseif($value[input] == "download") -->
	phpjs_viewdown('{:$value[default_val]}','{:$value[identifier]}');
	<!-- elseif($value[input] == "video") -->
	phpjs_viewvideo('{:$value[default_val]}','{:$value[identifier]}');
	<!-- elseif($value[input] == "module") -->
	phpjs_viewmodule('{:$value[default_val]}','{:$value[identifier]}');
	<!-- end -->
<!-- end -->
function to_submit()
{
	var subject = getid("subject").value;
	if(!subject)
	{
		alert("主题不允许为空");
		tab_set("main");
		getid("subject").focus();
		return false;
	}
	//[发布人]
	var author = getid("author").value;
	if(!author)
	{
		alert("发布人账号不允许为空");
		tab_set("ext");
		getid("author").focus();
		return false;
	}
	//发布时间
	var post_date = getid("post_date").value;
	if(!post_date)
	{
		alert("发布时间不允许为空");
		tab_set("ext");
		getid("post_date").focus();
		return false;
	}
	//判断核心模块是否必填
	<!-- if($ifcate) -->
	var cate_id = getid("cate_id").value;
	if(!cate_id || cate_id == "0")
	{
		alert("请选择分类");
		tab_set("main");
		return false;
	}
	<!-- end -->
	<!-- if($m_rs[if_thumb] && $m_rs[if_thumb_m]) -->
	var thumb_id = getid("thumb_id").value;
	if(!thumb_id)
	{
		alert("请选择缩略图信息");
		tab_set("main");
		return false;
	}
	<!-- end -->
	<!-- if($m_rs[if_sign_m]) -->
	var sign_chk = to_check_one(titleid,'identifier',false,true);
	if(!sign_chk)
	{
		tab_set("main");
		return false;
	}
	<!-- end -->
	<!-- $extlist AS $key=>$value -->
	<!-- if($value[if_must] && $value[input] != "radio" && $value[input] != "checkbox") -->
		var {:$value[identifier]} = $("#{:$value[identifier]}").val();
		if(!{:$value[identifier]})
		{
			alert("{:$value['error_note'] ? $value['error_note'] : '所有加红色星号信息均必须填写'}");
			tab_set("main");
			return false;
		}
	<!-- end -->
	<!-- end -->
	getid("_phpok_submit").disabled = true;
}
</script>
<!-- inc:footer -->